home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 4
/
Merciful - Disc 4.iso
/
software
/
p
/
punterv3.2r.dms
/
punterv3.2r.adf
/
punter_files
/
end.abk
/
end.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
2004-04-04
|
4KB
|
220 lines
'----------------------------
'- Bob Grabber Utility -
'- by Aaron Fothergill -
'- (c) Mandarin / Jawx 1990 -
'----------------------------
Y=0
YO=-1
SCH=200
SCW=320
Unpack 6 To 1
Gosub GTSCRN
SX=0 : SY=0 : SXO=-1 : XO=-1
Screen To Front 1
STZONES
SNUM=1
SHWSNUM[SNUM]
Do
K=Mouse Key : Z=Mouse Zone
If K=0 Then TICK=0
X=X Screen(X Mouse)
If X/160<>XO
XO=X/160
SHWSPRT[Y,SNUM,X]
End If
If K>0 and Z>0
On Z Gosub DWN,UP,CUT,GTSCRN,GTSPR,SVSPR,QUIT
SHWSPRT[Y,SNUM,X]
End If
If Y<>YO
YO=Y
DISPBAR[Y]
SHWSPRT[Y,SNUM,X]
End If
If SY<>SYO or SX<>SXO
DISPSCRN[SX,SY]
SXO=SX : SYO=SY
End If
A$=Inkey$
If A$=Chr$(30)
If Y>0
Add Y,-4
Else
If SY>0
Add SY,-4
End If
End If
End If
If A$=Chr$(31)
If Y<SCH-24
Add Y,4
Else
If SY<Max(0,SCY-SCH)
Add SY,4
End If
End If
End If
If A$=Chr$(28)
If SX>0
Add SX,-16
End If
End If
If A$=Chr$(29)
If SX<Max(0,SCX-SCW*REZ)
Add SX,16
End If
End If
Loop
QUIT:
End
Return
GTSPR:
SNUM=1
F$=""
F$=Fsel$("*.ABK","","Load a Sprite Bank")
If F$<>""
F2$=Right$(F$,4)
If Upper$(F2$)=".ABK"
Erase 1
Load F$
A$="" : A=0 : Repeat : A$=A$+Chr$(Peek(Start(1)-8+A)) : Inc A : Until A=8
If A$<>"Sprites "
F$=""
Else
Screen 0
Get Sprite Palette
Screen 1
End If
Else
F$=""
End If
End If
Return
SVSPR:
F$=Fsel$("","","Save the Sprite Bank As:")
If F$<>""
F2$=Right$(F$,4)
If Upper$(F2$)=".ABK"
Save F$,1
End If
End If
Return
CUT:
If Fast Free+Chip Free>10000
Bob 1,999,1,1
Update
Update Off
Screen To Front 0
Screen 0
Get Block 1,0,0,SCX,SCY
X2O=-1 : Y2O=-1
While Mouse Key<>0 : Wend : Wait 5
While Mouse Key=0 : Wend : X1=X Screen(X Mouse) : Y1=Y Screen(Y Mouse)
While Mouse Key>0 : X2=X Screen(X Mouse) : Y2=Y Screen(Y Mouse)
If X2O<>X2 or Y2O<>Y2
Gosub SHWBOX : X2O=X2 : Y2O=Y2
End If
Wend
Gosub SHWBOX : Put Block 1,0,0
Get Bob SNUM,Max(0,X1),Max(0,Y1) To Max(0,X2),Max(0,Y2)
Update On
Screen To Front 1 : Screen 1
Bob Off 1
Update
Del Block 1
End If
Return
SHWBOX:
Put Block 1,0,0
Ink 1
X3=Min(X1,X2) : X2=Max(X1,X2) : X1=X3
Y3=Min(Y1,Y2) : Y2=Max(Y1,Y2) : Y1=Y3
X2=Max(X1+1,X2) : Y2=Max(Y1+1,Y2)
Gr Writing 3
Box X1,Y1 To X2,Y2
Gr Writing 1
Return
DWN:
If SNUM>1
Dec SNUM
SHWSNUM[SNUM]
While Mouse Key<>0 and TICK<1000
Inc TICK
Wend : TICK=Min(TICK,500)
End If
Return
UP:
If SNUM<Length(1)+1
Inc SNUM
SHWSNUM[SNUM]
While Mouse Key<>0 and TICK<1000
Inc TICK
Wend : TICK=Min(TICK,500)
End If
Return
GTSCRN:
F$=Fsel$("","","Pick a Picture !")
If F$<>""
Auto View Off
Screen Close 0
If Upper$(Right$(F$,4))=".ABK"
Load F$,5
Unpack 5 To 0
Erase 5
Else
Load Iff F$,0
End If
A=Screen Base+72
SCX=Deek(A+4)
SCY=Deek(A+6)
REZ=1
If Btst(Deek(A),15)
REZ=2
End If
Screen To Front 1
Auto View On
End If
Return
Procedure DISPBAR[YPOS]
Screen Display 1,,48+YPOS,,24
End Proc
Procedure DISPSCRN[XPOS,YPOS]
Shared SCX,SCY
Screen Display 0,,48-YPOS,,SCY
Screen Offset 0,XPOS,0
End Proc
Procedure SHWSNUM[S]
S$=Mid$(Str$(S),2)
S$=Right$("00"+S$,3)
Ink 1,6
Text 68,18,S$
End Proc
Procedure STZONES
Screen 1
Reserve Zone 8
Set Zone 1,48,8 To 64,24
Set Zone 2,96,8 To 112,24
Set Zone 3,112,8 To 144,24
Set Zone 4,144,8 To 176,24
Set Zone 5,176,8 To 208,24
Set Zone 6,208,8 To 240,24
Set Zone 7,288,8 To 320,24
End Proc
Procedure SHWSPRT[YPOS,N,MX]
Screen 0
If Length(1)>=N
BX=80 : If MX<160
BX=240
End If
BY=YPOS+30+Deek(Sprite Base(N)+8)
If YPOS>100
BY=BY-34-Deek(Sprite Base(N)+2)
End If
Bob 1,BX,BY,N
Update
Else
Bob Off 1
Update
End If
Screen 1
End Proc